<div class="grid_12">
<form action="/adminarea/content" method="post">
Select page:
	<select name="page">
		<option value="" selected>Select page</option>
<?php foreach ($this->allPage as $page){
	?>		
		<option value="<?php echo $page->page; ?>" <?php echo $page->page == $this->needPage ? 'selected' : '';?>><?php echo$page->page; ?></option>
<?php }?>		
	</select> 
<?php 

if ('' != $this->needPage) {?>
Select item:
	<select name="item">
		<option value="" selected>Select item</option>
<?php 
foreach ($this->allItem as $item){
?>		
		<option value="<?php echo $item->item; ?>" <?php echo $item->item == $this->needItem ? 'selected' : '';?>><?php echo$item->item; ?></option>
<?php }?>		
	</select>
<?php 
}?>	
	
	<input type="submit"  value="show" /> 
</form>


</div>

<div class="clear"></div>

<?php if (isset($this->itemOnPage)){?>
<div class="grid_12">
<form action="/adminarea/contentedit/page/<?php echo $this->needPage;  ?>/item/<?php echo $this->needItem; ?>" method="post">

	<?php foreach ($this->itemOnPage as $item) { if ('title' != $item->item) continue?>
	<div>
<?php /* 	
		<div>Page: <?php echo $item->page; ?></div>
*/?>		
		<div><?php echo $item->item; ?>: <input name="text[<?php echo $item->id; ?>]" value="<?php echo $item->text; ?>" class="text"/></div>
	</div>

	<div class="clear"><br /></div>
	<div class="clear"><br /></div>

	<?php }?>

	<?php foreach ($this->itemOnPage as $item) { if ('title' == $item->item) continue?>
	<div>
		<div><?php echo $item->item; ?>: <textarea name="text[<?php echo $item->id; ?>]" cols="70" rows="10" class="edit_area"><?php echo nl2br($item->text); ?></textarea></div>
	</div>

	<div class="clear"><br /></div>
	<div class="clear"><br /></div>

	<?php }?>
	<input type="submit" value="save" />
</form>
</div>

<?php }?>